<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>


<script type="text/javascript">

  function fun(x) {
    var a = 123;
    function fun2() {
      console.log('fun2()');
    }


    fun2();
  }

  fun(123);
</script>
</body>
</html>